import upload from '@/utils/upload'
import request from '@/utils/request'



// 添加观众募集信息
export function addAudiProfile(data) {
	return request({
		//url: '/system/user/profile',
		// url: '/system/user/add',
		// 'url': '/auth/register', //微服务版本
		//method: 'put',//put
		//url: '/system/audi',
		url: '/system/audi/addAudi',
		//url:'http://localhost/dev-api/system/audi',
		method: 'post', //put
		data: data
	})
}
// 获取观众募集信息
export function getAudiProfileByUserAndTv(tvId,userId) {
	return request({
		url: `/system/audi/getProfileByUserAndTv`,
		method: 'get',
		params: {
			userId,
			tvId
		}
	});
}

// 编辑观众募集信息
export function updateAudiProfileByUserAndTv(data) {
  return request({
    url: `/system/audi/updateProfileByUserAndTv`,
    method: 'put',
    data: data
  });
}

// 获取观众募集信息
export function getAudiProfile(tvId) {
	const routeUrl = '/system/audi/' + tvId
	return request({
		url: routeUrl,
		method: 'get',
		//params: { tvId: tvId }
	})
}

// 更新观众募集信息
export function updateAudiProfile(data) {
	return request({
		url: '/system/audi/',
		method: 'put',
		data: data
	})
}

// 签到接口
export function signIn(tvId, endTime) {
	return request({
		url: '/system/audi/signIn',
		method: 'post',
		data: {
			tvId: tvId,
			endTime: endTime
		}
	});
}

// 签到接口
export function listSignedInUsers() {
	return request({
		url: '/system/audi/signed',
		method: 'get' 
	});
}
